<template>
    <div class="tag">
        <div  v-show="type=='default'">
            <Tag  class="tag-default" v-for="(tag,index) in tags" :key="index" :name="tag"><label class="tag-lable">{{tag}}</label></Tag>
        </div>
        <div class="tag-complete" v-show="type=='close'">
            <Tag class="complete-tag" type="border" closable @on-close="closeTag"
                 v-for="(tag,index) in tags" v-bind:key="index" :name="tag">{{tag}}</Tag>
        </div>
    </div>

</template>

<script>
    export default {
        name: "tags.vue",
        data() {
            return{
                inputag:'',
                count:'',
            }
        },
        props:{
            tags:Array,
            type:String,
        },
        methods:{
            closeTag (event, name){
                const index = this.tags.indexOf(name);
                window.console.log(name)
                this.tags.splice(index, 1);
            },
        }
    }

</script>

<style scoped>
    .tag-complete{
    }
    .tag-default {
    }
    .tag-lable{

    }
</style>